#include "hkrutils.h"

Hkrutils::Hkrutils()
{

}

/**

 * @brief WifiService::unicodeToUtf_8
 * @param resStr
 * @return
 */
QString Hkrutils::unicodeToUtf8(const QString resStr){
   QString temp;
   for(int i=0;i<resStr.length();){
       if(resStr.at(i)=='\\'){
           QString str = resStr.mid(i+2,i+4);
           temp.append(str.mid(0,2).toUShort(0,16));
           i=i+4;
         }else{
           temp.append(resStr.at(i));
           ++i;
       }
   }
   qDebug()<<"jack====temp="<<temp;
   QTextCodec *codec = QTextCodec::codecForName("UTF-8");
   QString desStr = codec->fromUnicode(temp);
   return QObject::trUtf8(desStr.toLatin1().data());
}
